
import re

body = '''Revision: 7
Author: sbchisholm
Date: Wed Nov 25 05:57:19 2009
Log: got Subscriber into the data store
http://code.google.com/p/svn-py-robot/source/detail?r=7

Modified:
 /trunk/email_handler.py
 /trunk/subscriber.py
 /trunk/svnny.py'''

lines = body.split('\n')
author = ''
date = ''
log_message = ''
revision = ''
files_modified = []
files_modified_flag = False

for line in lines:
	if files_modified_flag:
		match = re.search('^ /.+$', line)
		if match:
			files_modified.append(line)
		else:
			files_modified_flag = False
		continue
	match = re.search('^Author: (.+)$', line)
	if match:
		author = match.group(1)
		continue
	match = re.search('^Log: (.+)$', line)
	if match:
		log_message = match.group(1)
		continue
	match = re.search('^Revision: (.+)$', line)
	if match:
		revision = match.group(1)
		continue
	match = re.search('^Date: (.+)$', line)
	if match:
		date = match.group(1)
		continue
	match = re.search('^Modified:$', line)
	if match:
		files_modified_flag = True
		continue

print 'Author: ', author
print 'Log: ', log_message
print 'Revision: ', revision
print 'Date: ', date
print 'Files Modified: ', files_modified

